package com.clerkq.FP.model
{
	import com.clerkq.FP.event.FlipPageEvent;
	
	import flash.events.EventDispatcher;
	
	public class FlipPageModel extends EventDispatcher
	{
		private var _accRatio:AccelerateRatio;
		private var _flipArea:FlipArea;
    	private var _posPrecision:Number = 0.5;
    	private var _topPageDepth:int = 100;
    	private var _adjustEvenPage:Boolean = true;
    	private var _hasCover:Boolean = true;    	
		private var _visiblePages:VisiblePages;
		private var _shade:Object = {leftAlphaMin:0.4, leftAlphaMax:0.5, leftSizeMin:0.3, leftSizeMax:0.6, rightAlphaMin:0.4, rightAlphaMax:0.5, rightSizeMin:0.3, rightSizeMax:0.6};
		private var _pageShadow:Object = {under:1, beside:1, underAlphaMin:20, underAlphaMax:40, underSizeMin:10, underSizeMax:100, besideAlphaMin:40, besideAlphaMax:20, besideSizeMin:10, besideSizeMax:40};

		private var _pageWidth:Number = 115;
		private var _pageHeight:Number = 150;
		
		private var _pageList:Array;
		
		public function FlipPageModel()
		{
			super();
			_accRatio = new AccelerateRatio();
			_flipArea = new FlipArea();
			_visiblePages = new VisiblePages();
			_pageList = new Array();
		}
		
		public function addPage(pageInfo:PageInfo):void{
			_pageList.push(pageInfo);
			dispatchEvent(new FlipPageEvent(FlipPageEvent.ON_ADDPAGE, false, false, {listCount:_pageList.length}));
		}
		
		//======================================================================
		//						Get and Set
		//======================================================================
		public function get accRatio():AccelerateRatio			{		return _accRatio;				}
		public function get flipArea():FlipArea					{		return _flipArea;				}
		public function get posPrecision():Number				{		return _posPrecision;			}
		public function get topPageDepth():int					{		return _topPageDepth;			}
		public function get adjustEvenPage():Boolean			{		return _adjustEvenPage;			}
		public function get hasCover():Boolean					{		return _hasCover;				}
		public function get visiblePages():VisiblePages			{		return _visiblePages;			}
		public function get shade():Object						{		return _shade;					}
		public function get pageShadow():Object					{		return _pageShadow;				}
		public function get pageWidth():Number					{		return _pageWidth;				}
		public function get pageHeight():Number					{		return _pageHeight;				}
		public function get pageList():Array					{		return _pageList;				}
		
		public function set accRatio(value:AccelerateRatio):void	{		_accRatio = value;				}
		public function set flipArea(value:FlipArea):void			{		_flipArea = value;				}
		public function set hasCover(value:Boolean):void			{		_hasCover = value;				}
		public function set visiblePages(value:VisiblePages):void	{		_visiblePages = value;			}
		public function set pageWidth(value:Number):void			{		_pageWidth = value;				}
		public function set pageHeight(value:Number):void			{		_pageHeight = value;			}
		public function set pageList(value:Array):void				{		_pageList = value;			}

	}
}